{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}/Volumes/G-DRIVE slim/Columbia/Private Member Bills/Sevi/Replication/log_.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}19 Oct 2022, 14:28:27

{com}. do "/var/folders/4l/z9fwjdg12ts9zx8q_8wj4wy40000gn/T//SD25798.000000"
{txt}
{com}. 
. *Loewen et al's code to set up their data
. 
. *****Data set-up
. **excluding two excluded members
. drop if excluded==1
{txt}(2 observations deleted)

{com}. **indicator of legislation initiated in the Senate
. replace senate=0 if senate==.
{txt}(399 real changes made)

{com}. **indicator for members who had to power to propose but did not
. gen OPTOUT=0
{txt}
{com}. replace OPTOUT=1 if place<=87 & election==2006 & check==0
{txt}(12 real changes made)

{com}. replace OPTOUT=1 if place<117 & election==2008 & check==0
{txt}(3 real changes made)

{com}. 
. ***creating indicator of power to propose
. gen P2P=0
{txt}
{com}. replace P2P=1 if place<=87 & election==2006 
{txt}(79 real changes made)

{com}. replace P2P=1 if place<117 & election==2008
{txt}(86 real changes made)

{com}. **interaction with membership in government caucus
. gen govP2P=gov*P2P
{txt}
{com}. 
. 
. 
. 
. *Our code using Loewen et al's data
. 
. *Figure 1: Incumbent Vote Shares by Session, Membership in the Governing Party, and Data Source
. 
. *Fix label for election to match our data
. label define election_lab 2006 "2004-2006" 2008 "2006-2008"
{txt}
{com}. label values election election_lab
{txt}
{com}. *Create the means for graph
. summarize current if election == 2006 & gov == 0 & P2P == 0

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
current_vote {c |}{res}         93    51.14075    9.643369      29.02      82.56
{txt}
{com}. local mean_2006_gov0_p2p0 = round(r(mean),.01)
{txt}
{com}. local n_2006_gov0_p2p0 = r(N)
{txt}
{com}. summarize current if election == 2006 & gov == 0 & P2P == 1

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
current_vote {c |}{res}         62       50.06    11.92837      24.19      75.75
{txt}
{com}. local mean_2006_gov0_p2p1 = round(r(mean),.01)
{txt}
{com}. local n_2006_gov0_p2p1 = r(N)
{txt}
{com}. summarize current if election == 2006 & gov == 1 & P2P == 0

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
current_vote {c |}{res}         34    43.06823     8.41891      24.23      57.17
{txt}
{com}. local mean_2006_gov1_p2p0 = round(r(mean),.01)
{txt}
{com}. local n_2006_gov1_p2p0 = r(N)
{txt}
{com}. summarize current if election == 2006 & gov == 1 & P2P == 1

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
current_vote {c |}{res}         17    47.25824    7.672777      36.52      65.62
{txt}
{com}. local mean_2006_gov1_p2p1 = round(r(mean),.01)
{txt}
{com}. local n_2006_gov1_p2p1 = r(N)
{txt}
{com}. summarize current if election == 2008 & gov == 0 & P2P == 0

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
current_vote {c |}{res}         81    44.72716    8.239964         28       70.3
{txt}
{com}. local mean_2008_gov0_p2p0 = round(r(mean),.01)
{txt}
{com}. local n_2008_gov0_p2p0 = r(N)
{txt}
{com}. summarize current if election == 2008 & gov == 0 & P2P == 1

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
current_vote {c |}{res}         65    45.31169     7.77769      29.13       70.3
{txt}
{com}. local mean_2008_gov0_p2p1 = round(r(mean),.01)
{txt}
{com}. local n_2008_gov0_p2p1 = r(N)
{txt}
{com}. summarize current if election == 2008 & gov == 1 & P2P == 0

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
current_vote {c |}{res}         31    52.73226    9.511235       35.2       77.1
{txt}
{com}. local mean_2008_gov1_p2p0 = round(r(mean),.01)
{txt}
{com}. local n_2008_gov1_p2p0 = r(N)
{txt}
{com}. summarize current if election == 2008 & gov == 1 & P2P == 1

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
current_vote {c |}{res}         21    58.00952    10.20318         40         82
{txt}
{com}. local mean_2008_gov1_p2p1 = round(r(mean),.01)
{txt}
{com}. local n_2008_gov1_p2p1 = r(N)
{txt}
{com}. 
. *N for the graph
. summarize current if election == 2006 

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
current_vote {c |}{res}        206    49.16272    10.41907      24.19      82.56
{txt}
{com}. local n_2006 = r(N)
{txt}
{com}. summarize current if election == 2008 

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
current_vote {c |}{res}        198    47.58111    9.611792         28         82
{txt}
{com}. local n_2008 = r(N)     
{txt}
{com}. 
. *Create figure 
. graph box current if election == 2006, over(P2P, relabel(1 "Control" 2 "Treatment")label(labsize(*1))) ///
>         over(gov, relabel(1 "Opposition" 2 "Government")) ///
>         ytitle("") intensity(0) ///
>         medline(lcolor(grey*.5)) marker(1,mfcolor(white)) ///
>         text(42 9 "{c -(}&mu{c )-}=`mean_2006_gov0_p2p0'" 36 9 "N=`n_2006_gov0_p2p0'" ///
>         37 33 "{c -(}&mu{c )-}=`mean_2006_gov0_p2p1'" 31 33 "N=`n_2006_gov0_p2p1'" ///
>         35 69 "{c -(}&mu{c )-}=`mean_2006_gov1_p2p0'" 29 69 "N=`n_2006_gov1_p2p0'" ///
>         34 90 "{c -(}&mu{c )-}=`mean_2006_gov1_p2p1'" 28 90 "N=`n_2006_gov1_p2p1'", place(e)size(small)) ///      
>         yscale(range(-5 85)) ylabel(0(20)80) title("2004-2006 (N=`n_2006')", box width(126)) saving("loewen_data_f1")
{res}{p 0 4 2}
{txt}(note:  named style
grey not found in class
color,  default attributes used)
{p_end}
{res}{txt}(file loewen_data_f1.gph saved)

{com}.         
. graph box current if election == 2008, over(P2P, relabel(1 "Control" 2 "Treatment")label(labsize(*1))) ///
>         over(gov, relabel(1 "Opposition" 2 "Government")) ///
>         ytitle("") intensity(0) ///
>         medline(lcolor(grey*.5)) marker(1,mfcolor(white)) ///
>         text(36 9 "{c -(}&mu{c )-}=`mean_2008_gov0_p2p0'" 30 9 "N=`n_2008_gov0_p2p0'" ///
>         38 33 "{c -(}&mu{c )-}=`mean_2008_gov0_p2p1'" 32 33 "N=`n_2008_gov0_p2p1'" ///
>         45 69 "{c -(}&mu{c )-}=`mean_2008_gov1_p2p0'" 39 69 "N=`n_2008_gov1_p2p0'" ///
>         37 90 "{c -(}&mu{c )-}=`mean_2008_gov1_p2p1'" 31 90 "N=`n_2008_gov1_p2p1'", place(e)size(small)) ///              
>         yscale(range(-5 85)) ylabel(0(20)80) title("2006-2008 (N=`n_2008')", box width(126)) saving("loewen_data_f2")   
{res}{p 0 4 2}
{txt}(note:  named style
grey not found in class
color,  default attributes used)
{p_end}
{res}{txt}(file loewen_data_f2.gph saved)

{com}. 
. graph combine loewen_data_f1.gph loewen_data_f2.gph, col(1) title("Loewen et al.'s data") ycommon saving("loewen")
{res}{p 0 4 2}
{txt}(note:  named style
grey not found in class
color,  default attributes used)
{p_end}
{res}{p 0 4 2}
{txt}(note:  named style
grey not found in class
color,  default attributes used)
{p_end}
{res}{txt}(file loewen.gph saved)

{com}. 
. 
. **A2.2: Replication of Loewen et al. 2014 using their data 
. eststo clear
{txt}
{com}. eststo: regress current gov P2P previous ib1.election if election == 2006 | election == 2008, robust 
{p 0 6 2}{txt}note: 1b.election identifies no observations in the sample{p_end}
{p 0 6 2}note: 2008.election omitted because of collinearity{p_end}

Linear regression                               Number of obs     = {res}       404
                                                {txt}F(4, 399)         =  {res}   141.12
                                                {txt}Prob > F          = {res}    0.0000
                                                {txt}R-squared         = {res}    0.6051
                                                {txt}Root MSE          =    {res} 6.3474

{txt}{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1} current_vote{col 15}{c |}      Coef.{col 27}   Std. Err.{col 39}      t{col 47}   P>|t|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 10}gov {c |}{col 15}{res}{space 2} 1.393229{col 27}{space 2} .7438154{col 38}{space 1}    1.87{col 47}{space 3}0.062{col 55}{space 4}-.0690581{col 68}{space 3} 2.855516
{txt}{space 10}P2P {c |}{col 15}{res}{space 2}-.0723327{col 27}{space 2} .6305836{col 38}{space 1}   -0.11{col 47}{space 3}0.909{col 55}{space 4}-1.312014{col 68}{space 3} 1.167349
{txt}previous_vote {c |}{col 15}{res}{space 2}  .830476{col 27}{space 2} .0358889{col 38}{space 1}   23.14{col 47}{space 3}0.000{col 55}{space 4}  .759921{col 68}{space 3}  .901031
{txt}{space 13} {c |}
{space 5}election {c |}
{space 11}1  {c |}{col 15}{res}{space 2}        0{col 27}{txt}  (empty)
{space 3}2004-2006  {c |}{col 15}{res}{space 2} .0425143{col 27}{space 2} .6384227{col 38}{space 1}    0.07{col 47}{space 3}0.947{col 55}{space 4}-1.212578{col 68}{space 3} 1.297607
{txt}{space 3}2006-2008  {c |}{col 15}{res}{space 2}        0{col 27}{txt}  (omitted)
{space 13} {c |}
{space 8}_cons {c |}{col 15}{res}{space 2} 7.255352{col 27}{space 2} 1.797982{col 38}{space 1}    4.04{col 47}{space 3}0.000{col 55}{space 4}  3.72065{col 68}{space 3} 10.79005
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}({res}est1{txt} stored)

{com}. eststo: regress current gov P2P previous ib1.election if election == 2006 | election == 2008, cluster(id)
{p 0 6 2}{txt}note: 1b.election identifies no observations in the sample{p_end}
{p 0 6 2}note: 2008.election omitted because of collinearity{p_end}

Linear regression                               Number of obs     = {res}       404
                                                {txt}F(4, 290)         =  {res}   122.74
                                                {txt}Prob > F          = {res}    0.0000
                                                {txt}R-squared         = {res}    0.6051
                                                {txt}Root MSE          =    {res} 6.3474

{txt}{ralign 79:(Std. Err. adjusted for {res:291} clusters in id)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1} current_vote{col 15}{c |}      Coef.{col 27}   Std. Err.{col 39}      t{col 47}   P>|t|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 10}gov {c |}{col 15}{res}{space 2} 1.393229{col 27}{space 2} .7264934{col 38}{space 1}    1.92{col 47}{space 3}0.056{col 55}{space 4}-.0366393{col 68}{space 3} 2.823097
{txt}{space 10}P2P {c |}{col 15}{res}{space 2}-.0723327{col 27}{space 2} .6263794{col 38}{space 1}   -0.12{col 47}{space 3}0.908{col 55}{space 4}-1.305159{col 68}{space 3} 1.160493
{txt}previous_vote {c |}{col 15}{res}{space 2}  .830476{col 27}{space 2} .0385177{col 38}{space 1}   21.56{col 47}{space 3}0.000{col 55}{space 4} .7546663{col 68}{space 3} .9062857
{txt}{space 13} {c |}
{space 5}election {c |}
{space 11}1  {c |}{col 15}{res}{space 2}        0{col 27}{txt}  (empty)
{space 3}2004-2006  {c |}{col 15}{res}{space 2} .0425143{col 27}{space 2} .5825266{col 38}{space 1}    0.07{col 47}{space 3}0.942{col 55}{space 4}-1.104002{col 68}{space 3}  1.18903
{txt}{space 3}2006-2008  {c |}{col 15}{res}{space 2}        0{col 27}{txt}  (omitted)
{space 13} {c |}
{space 8}_cons {c |}{col 15}{res}{space 2} 7.255352{col 27}{space 2} 1.929565{col 38}{space 1}    3.76{col 47}{space 3}0.000{col 55}{space 4} 3.457624{col 68}{space 3} 11.05308
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}({res}est2{txt} stored)

{com}. eststo: regress current i.gov##i.P2P previous ib1.election if election == 2006 | election == 2008, robust       
{p 0 6 2}{txt}note: 1b.election identifies no observations in the sample{p_end}
{p 0 6 2}note: 2008.election omitted because of collinearity{p_end}

Linear regression                               Number of obs     = {res}       404
                                                {txt}F(5, 398)         =  {res}   118.17
                                                {txt}Prob > F          = {res}    0.0000
                                                {txt}R-squared         = {res}    0.6112
                                                {txt}Root MSE          =    {res} 6.3064

{txt}{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1} current_vote{col 15}{c |}      Coef.{col 27}   Std. Err.{col 39}      t{col 47}   P>|t|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 8}1.gov {c |}{col 15}{res}{space 2}-.0172048{col 27}{space 2} .9893289{col 38}{space 1}   -0.02{col 47}{space 3}0.986{col 55}{space 4}-1.962168{col 68}{space 3} 1.927759
{txt}{space 8}1.P2P {c |}{col 15}{res}{space 2}-.9752166{col 27}{space 2} .7246735{col 38}{space 1}   -1.35{col 47}{space 3}0.179{col 55}{space 4}-2.399883{col 68}{space 3} .4494497
{txt}{space 13} {c |}
{space 6}gov#P2P {c |}
{space 9}1 1  {c |}{col 15}{res}{space 2} 3.701969{col 27}{space 2} 1.458807{col 38}{space 1}    2.54{col 47}{space 3}0.012{col 55}{space 4} .8340381{col 68}{space 3}   6.5699
{txt}{space 13} {c |}
previous_vote {c |}{col 15}{res}{space 2} .8248963{col 27}{space 2} .0357233{col 38}{space 1}   23.09{col 47}{space 3}0.000{col 55}{space 4} .7546664{col 68}{space 3} .8951262
{txt}{space 13} {c |}
{space 5}election {c |}
{space 11}1  {c |}{col 15}{res}{space 2}        0{col 27}{txt}  (empty)
{space 3}2004-2006  {c |}{col 15}{res}{space 2} .0729599{col 27}{space 2} .6372661{col 38}{space 1}    0.11{col 47}{space 3}0.909{col 55}{space 4}-1.179868{col 68}{space 3} 1.325788
{txt}{space 3}2006-2008  {c |}{col 15}{res}{space 2}        0{col 27}{txt}  (omitted)
{space 13} {c |}
{space 8}_cons {c |}{col 15}{res}{space 2} 7.893986{col 27}{space 2} 1.807923{col 38}{space 1}    4.37{col 47}{space 3}0.000{col 55}{space 4} 4.339714{col 68}{space 3} 11.44826
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}({res}est3{txt} stored)

{com}. eststo: regress current i.gov##i.P2P previous ib1.election if election == 2006 | election == 2008, cluster(id)  
{p 0 6 2}{txt}note: 1b.election identifies no observations in the sample{p_end}
{p 0 6 2}note: 2008.election omitted because of collinearity{p_end}

Linear regression                               Number of obs     = {res}       404
                                                {txt}F(5, 290)         =  {res}   104.25
                                                {txt}Prob > F          = {res}    0.0000
                                                {txt}R-squared         = {res}    0.6112
                                                {txt}Root MSE          =    {res} 6.3064

{txt}{ralign 79:(Std. Err. adjusted for {res:291} clusters in id)}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1} current_vote{col 15}{c |}      Coef.{col 27}   Std. Err.{col 39}      t{col 47}   P>|t|{col 55}     [95% Con{col 68}f. Interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 8}1.gov {c |}{col 15}{res}{space 2}-.0172048{col 27}{space 2} .9692417{col 38}{space 1}   -0.02{col 47}{space 3}0.986{col 55}{space 4}-1.924845{col 68}{space 3} 1.890435
{txt}{space 8}1.P2P {c |}{col 15}{res}{space 2}-.9752166{col 27}{space 2} .7249788{col 38}{space 1}   -1.35{col 47}{space 3}0.180{col 55}{space 4}-2.402104{col 68}{space 3} .4516706
{txt}{space 13} {c |}
{space 6}gov#P2P {c |}
{space 9}1 1  {c |}{col 15}{res}{space 2} 3.701969{col 27}{space 2} 1.436119{col 38}{space 1}    2.58{col 47}{space 3}0.010{col 55}{space 4} .8754322{col 68}{space 3} 6.528506
{txt}{space 13} {c |}
previous_vote {c |}{col 15}{res}{space 2} .8248963{col 27}{space 2}  .037944{col 38}{space 1}   21.74{col 47}{space 3}0.000{col 55}{space 4} .7502157{col 68}{space 3} .8995769
{txt}{space 13} {c |}
{space 5}election {c |}
{space 11}1  {c |}{col 15}{res}{space 2}        0{col 27}{txt}  (empty)
{space 3}2004-2006  {c |}{col 15}{res}{space 2} .0729599{col 27}{space 2} .5826087{col 38}{space 1}    0.13{col 47}{space 3}0.900{col 55}{space 4}-1.073718{col 68}{space 3} 1.219637
{txt}{space 3}2006-2008  {c |}{col 15}{res}{space 2}        0{col 27}{txt}  (omitted)
{space 13} {c |}
{space 8}_cons {c |}{col 15}{res}{space 2} 7.893986{col 27}{space 2} 1.918483{col 38}{space 1}    4.11{col 47}{space 3}0.000{col 55}{space 4} 4.118071{col 68}{space 3}  11.6699
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}({res}est4{txt} stored)

{com}. ereturn list    

{txt}scalars:
               e(rank) =  {res}6
               {txt}e(ll_0) =  {res}-1505.024118724857
                 {txt}e(ll) =  {res}-1314.220358101566
               {txt}e(r2_a) =  {res}.606269461356185
                {txt}e(rss) =  {res}15828.68672513228
                {txt}e(mss) =  {res}24878.18764799613
               {txt}e(rmse) =  {res}6.306391175715029
                 {txt}e(r2) =  {res}.6111544556321628
                  {txt}e(F) =  {res}104.2472952302884
               {txt}e(df_r) =  {res}290
               {txt}e(df_m) =  {res}5
                  {txt}e(N) =  {res}404
            {txt}e(N_clust) =  {res}291

{txt}macros:
            e(cmdline) : "{res}regress current i.gov##i.P2P previous ib1.election if election == 2006 | elec{txt}.."
              e(title) : "{res}Linear regression{txt}"
          e(marginsok) : "{res}XB default{txt}"
                e(vce) : "{res}cluster{txt}"
             e(depvar) : "{res}current_vote{txt}"
                e(cmd) : "{res}regress{txt}"
         e(properties) : "{res}b V{txt}"
            e(predict) : "{res}regres_p{txt}"
              e(model) : "{res}ols{txt}"
          e(estat_cmd) : "{res}regress_estat{txt}"
            e(vcetype) : "{res}Robust{txt}"
           e(clustvar) : "{res}id{txt}"

matrices:
                  e(b) : {res} 1 x 13
                  {txt}e(V) : {res} 13 x 13
       {txt}e(V_modelbased) : {res} 13 x 13

{txt}functions:
             e(sample)   

{com}. * Saves table in rtf file 
. esttab using "A2.2.rtf",   ///
>                 label replace nogap nobaselevels nostar compress b(3) se(3)     ///
>                 scalars("N N" "r2 R2" "r2_a R2 Adj." "rmse Root MSE") 
{res}{txt}(note: file A2.2.rtf not found)
(output written to {browse  `"A2.2.rtf"'})

{com}. 
{txt}end of do-file

{com}. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}/Volumes/G-DRIVE slim/Columbia/Private Member Bills/Sevi/Replication/log_.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}19 Oct 2022, 14:28:44
{txt}{.-}
{smcl}
{txt}{sf}{ul off}